package com.rogers.monster.dao.impl;

import java.util.List;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;

import com.rogers.monster.dao.OrganizationsDao;

public class OrganizationsDaoImpl implements OrganizationsDao {
	
	private JdbcTemplate jdbcTemplate;

	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}
	
	
	public List getListOfOrganizations() {
		StringBuffer sql = new StringBuffer()
		.append(" select organization_name")
		.append(" from organizations");
		return this.jdbcTemplate.queryForList(sql.toString());
	}

}
